package zero.tech.games.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import zero.tech.redis.cache.RedisUtil;

@Component
public class UserOnlineUtil {
	@Autowired
	private RedisUtil  redisUtil;

	public void insert(String source, int uid) {
		redisUtil.hset(RedisConsts.B_USER_ONLINE_STATUS, String.valueOf(uid), source);
	}

	public String getSource(int uid) {
		return (String) redisUtil.hget(RedisConsts.B_USER_ONLINE_STATUS, String.valueOf(uid));
	}
}
